<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
   <meta charset="utf-8">
   <title>首页--layui后台管理模板</title>
   <meta name="renderer" content="webkit">
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
   <meta name="apple-mobile-web-app-status-bar-style" content="black">
   <meta name="apple-mobile-web-app-capable" content="yes">
   <meta name="format-detection" content="telephone=no">
   <link rel="stylesheet" href="../../css/common.css"/>
   <link rel="stylesheet" href="../../lib/layui/css/layui.css" media="all"/>
   <script type="text/javascript" src="../../lib/echarts/echarts.min.js"></script>
   <script type="text/javascript" src="../../lib/echarts/world/js/china.js"></script>
   <style type="text/css">
      .map {
         padding: 20px;
         height: 350px;
      }
   </style>
</head>
<body class="childrenBody home">
<div class="layui-row layui-col-space15">
   <div class="layui-col-md6">
      <div class="layui-card">
         <div class="yskj-card-body clearfix cart-data">
            <div class="map" id="china1"></div>
         </div>
      </div>
   </div>
   <div class="layui-col-md6">
      <div class="layui-card">
         <div class="yskj-card-body clearfix cart-data">
            <div class="map" id="china2"></div>
         </div>
      </div>
   </div>
   <div class="layui-col-md6">
      <div class="layui-card">
         <div class="yskj-card-body clearfix cart-data">
            <div class="map" id="china3"></div>
         </div>
      </div>
   </div>
   <div class="layui-col-md6">
      <div class="layui-card">
         <div class="yskj-card-body clearfix cart-data">
            <div class="map" id="china4"></div>
         </div>
      </div>
   </div>
</div>
</body>
</html>
<script type="text/javascript" src="../../lib/layui/layui.js"></script>
<script type="text/javascript">
  function clone(origin) {
    return JSON.parse(JSON.stringify(origin))
  }

  layui.config({
    base: "../../js/"
  }).use(["jquery", "mapTest", "echartsData"], function () {
    var $ = layui.jquery,
      echartsData = layui.echartsData;
    var data = echartsData.Address;//地图数据
    var chinaData = echartsData.mapChina2;
    var max = 1;//最高的数据
    for (var i = 0; i < data.length; i++) {
      if (data[i].value > max) {
        max = data[i].value;
      }
    }
    chinaData.visualMap.max = max;
    chinaData.series[0].data = data;

    china1();
    china2();
    china3();
    china4();

    function china1() {
      let chinaTemp = JSON.parse(JSON.stringify(chinaData));
      let china1 = echarts.init($('#china1')[0]);
      china1.setOption(chinaTemp);
    }

    function china2() {
      let chinaTemp = JSON.parse(JSON.stringify(chinaData));
      chinaTemp.visualMap.show = false;//不显示数据条
      let china1 = echarts.init($('#china2')[0]);
      china1.setOption(chinaTemp);
    }

    function china3() {
      let chinaTemp = echartsData.mapChina3;
      let china1 = echarts.init($('#china3')[0]);
      china1.setOption(chinaTemp);
    }

    function china4() {
      let chinaTemp = JSON.parse(JSON.stringify(echartsData.mapChina3));
      chinaTemp.visualMap.show = false;//不显示数据条
      let china1 = echarts.init($('#china4')[0]);
      china1.setOption(chinaTemp);
    }


  });


</script>
